Dynomotion

Group: DynoMotion Message: 7875 From: daveymahomh600e Date: 7/8/2013
Subject: Simple Internal Switch
Hi Tom,

My system uses KFlop and a SnapAmp and I am looking for the best way to implement a simple internal switch within a User Button based c program.

I want to be able to interrupt a probing loop if another user button is clicked and wasn't sure if a bit command or something else would be the simplest / most reliable.

Thank you,
David.
Group: DynoMotion Message: 7879 From: Tom Kerekes Date: 7/8/2013
Subject: Re: Simple Internal Switch
Hi David,

Probably a Virtual Bit might be best.  I believe you might just configure the User Button to set a Virtual IO Bit such as IO 48.   Then in your Probe program you would need to check for the bit inside every wait loop with something like:

if (ReadBit(48))  // check for abort
{
    Jog(0,0);  // stop the axis
    return;  // exit
}

HTH
Regards
TK


Group: DynoMotion Message: 7883 From: David Stevenson Date: 7/9/2013
Subject: Re: Simple Internal Switch

Hi Tom,
 
I made a small c program to use with a user button to pause the probing. First it started like this...
 
#include "KMotionDef.h"
 
SetBit(48);
 
For reasons which I'm sure are obvious to you it didn't compile.
 
So I tried this (and several similar versions of this)...
 
#include "KMotionDef.h"
 
#define ProbePauseBit 48
 
Main()
{
 SetBit(ProbePauseBit);
}
 
Again, no joy compiling.
 
Could I trouble you for your expertise?
 
Thanks in advance,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Monday, July 08, 2013 9:12 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Simple Internal Switch

 

Hi David,

Probably a Virtual Bit might be best.  I believe you might just configure the User Button to set a Virtual IO Bit such as IO 48.   Then in your Probe program you would need to check for the bit inside every wait loop with something like:

if (ReadBit(48))  // check for abort
{
    Jog(0,0);  // stop the axis
    return;  // exit
}

HTH
Regards
TK


Group: DynoMotion Message: 7888 From: Tom Kerekes Date: 7/9/2013
Subject: Re: Simple Internal Switch
Hi David,

I think the "M" in main is capitalized.  You shouldn't actually need a program to set a bit.  You can configure buttons to set a bit directly.

Regards
TK


Group: DynoMotion Message: 7893 From: David Stevenson Date: 7/9/2013
Subject: Re: Simple Internal Switch

Hi Tom,
 
Configuring the button does seem like the obvious solution.  :o)
 
Thank you,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Tuesday, July 09, 2013 12:01 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Simple Internal Switch

 

Hi David,

I think the "M" in main is capitalized.  You shouldn't actually need a program to set a bit.  You can configure buttons to set a bit directly.

Regards
TK